package com.zhiyun.test.base.util;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

import java.util.Objects;

/**
 * Created by user on 2019-5-27.
 */
public class DriverUtil {
  public WebDriver getDriver(String driverType,String driverPath){
    if (Objects.equals(driverType, "chrome")) {
      System.setProperty("webdriver.chrome.driver", driverPath);
      return new ChromeDriver();
    }
    return null;
  }
  public WebDriver getDriver(){
    return getDriver(PropUtil.getProp("driver.prop","chromeType"),PropUtil.getProp("driver.prop","chromePath"));
  }
}
